dal_database = require("./DataBase");

exports.get = function (nickname, password, callback){
	dal_database.db.query("SELECT * FROM personnal WHERE nickname='" + nickname + "' AND password='" + password + "' LIMIT 1", function(err, res, fields) {
		if (err) throw err;
		callback(res[0]);
	});
};

exports.insert = function (login, password, callback){
	dal_database.db.query("INSERT IGNORE INTO personnal SET nickname='" + nickname + "', password='" + password + "'", function(err, res, fields) {
		if (err) throw err;
	});
	callback(res);
};
